//adler32
#define uint32_t int //need ensure uint32_t is 32bit variable 
#define key "kladjalsdkfj"

uint32_t adler32(const char* buffer,const char* mac) {
     uint32_t s1 = 1;
     uint32_t s2 = 0;
     int n=0;
     while(buffer[n]!='\0'){
        s1 = (s1 + buffer[n]) % 65521;
        s2 = (s2 + s1) % 65521;
	n++;
     }     
     n=0;
     while(mac[n]!='\0'){
        s1 = (s1 + mac[n]) % 65521;
        s2 = (s2 + s1) % 65521;
        n++;
     }
     n=0;
     const char* ckey=key;
     while(ckey[n]!='\0'){
        s1 = (s1 + ckey[n]) % 65521;
        s2 = (s2 + s1) % 65521;
        n++;
     }
     return (s2 << 16) | s1;
}

// ...


int main(){
	const char* word="hello world";
	uint32_t hashAddress = adler32(word,"00:34:35:4d:35:46");
	printf("%x",hashAddress);
	return 0;
}
